package updown.handler.ex;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

/**
 * <p>Title: updown.handler </p>
 * <p>Description:updown: - 全局异常捕获处理类 </p>
 *
 * @Author:jiangkaixin
 * @Date:2022/1/5
 * @Version: 1.0
 */

@Slf4j
@ControllerAdvice
public class ExceptionAop {
    /**
     * 自定义信息异常
     * @param e
     * @return
     */
    @ExceptionHandler(ParkException.class)
    public void handlerParkException(ParkException e) {
        log.info("ParkException error:{}",e);
    }

    /**
     * 捕获数据库报错，等系统异常
     * @param e
     * @return
     */
    @ExceptionHandler(Exception.class)
    public void handlerException(Exception e) {
        log.info("Exception error:{}",e);
    }
}
